﻿YUI.add('excellent-project-app', function (Y) {

    Y.ExcellentApp = Y.Base.create('ExcellentApp', Y.App, [], {
        initializer: function () {

            this.on('*:navigateToView', this.navigateToView);

            //Al pulsar el boton inicio en cualquier pantalla volvemos al menu
            this.on('*:inicio', function (ev) { this.showView('catalogos') });

        },

        navigateToView: function (ev) {
            this.showView(ev.viewName, { model: ev.model, modelList: ev.modelList });
        },
        container: '#yuicontainer',
        viewContainer: '#yuicontainer',
        views:
        {
            catalogos: { type: 'CatalogosView' },
            editarCatalogo: { type: 'EditarCatalogoView', parent: 'catalogos' },
            preguntas: { type: 'PreguntasView' },
            parciales: { type: 'ParcialesView' }
        }

    }, {});

}, '1.0.0', {
    requires: ['app', 'catalogo-list-view', 'node', 'handlebars-link-helper', 
        'handlebars-select-helper', 'io', 'editar-catalogo-view', 'parcial-list-view']
});
